<section id="content">
    <section class="vbox">
        <section class="scrollable padder">
            <ul class="breadcrumb no-border no-radius b-b b-light pull-in">
                <li><a href="{:url('Home/index')}"><i class="fa fa-home"></i> 首页</a></li>
                <li class="active">编辑问答</li>
            </ul>
            <div class="m-b-md">
                <h3 class="m-b-none" style="display: flex;justify-content: space-between;">
                    <a href="{:url('Qa/index',array('page'=>$page,'search_value'=>$search.search_value))}" class="btn btn-s-md btn-default">返&nbsp;&nbsp;回</a>
                    {if $qaMain.id > 0 }
                    <a href="{:url('QaBank/list',array('qa_main_id'=>$qaMain.id))}" class="btn btn-s-md btn-info">题目设置</a>
                    {/if}
                </h3>
            </div>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="tab-content">

                        <!-- 基础信息 -->
                        <div class="tab-pane" id="main">
                            <div class="row m-l-none m-r-none bg-light lter">
                                <form method="post" action="{:url('Qa/edit',array('page'=>$page,'search_value'=>$search.search_value))}" enctype="multipart/form-data">
                                    <input type="text" class="form-control" name="id" value="{$qaMain.id?$qaMain.id:''}" style="width:300px;display: none">
                                    <div class="table-responsive">
                                        <table class="table table-striped b-t b-light">
                                            <tbody>
                                                <tr>
                                                    <th style="vertical-align: middle;"><span style="color: red">*</span>标题：</th>
                                                    <td>
                                                        <input type="text" class="form-control" id="title" name="title" value="{$qaMain.title?$qaMain.title:''}">
                                                        <span>(总字数建议小于100字)</span>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <th style="vertical-align: middle;">问答状态：</th>
                                                    <td>
                                                        <select name="status" id="status" style="width:250px;padding: 5px 10px;border: 1px solid #d9d9d9;border-radius: 3px;">
                                                            <option value="0" {$qaMain.status==0?'selected':''}>下线
                                                            </option>
                                                            <option value="1" {$qaMain.status==1?'selected':''}>上线
                                                            </option>
                                                        </select>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <th></th>
                                                    <td>
                                                        <input type="submit" value="保存" class="btn btn-s-md btn-success">
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </form>
                            </div>
                        </div>

                    </div>
                </div>
            </section>
        </section>
    </section>
</section>

<script>
    $(function() {

    });

    $('#img').uploadifive({
        'auto': true,
        'fileType': 'image/*',
        'multi': true,
        'uploadLimit': 0,
        'queueSizeLimit': 0,
        'buttonClass': 'uploadifive-button',
        'buttonText': '选择图片(4M以内)',
        'fileSizeLimit': '4MB',
        'uploadScript': "{:url('home/Upload/upload')}",
        'onAddQueueItem': function(file) {
            this.data('uploadifive').settings.formData = {
                'type': 1
            };
        },
        'onUploadComplete': function(file, response) {
            var data = JSON.parse(response);
            if (data.response_code == 0) {
                document.getElementById('cover_image').value = data.data.url;
                document.getElementById('update_img').src = data.data.url;
            } else {
                alert(data.msg);
            }
        }
    });
</script>

<style>
    .nowrap {
        white-space: nowrap;
    }

    .tab-pane span {
        line-height: 34px;
        padding-left: 10px;
    }

    .section hr {
        margin-bottom: 10px;
        margin-top: 10px;
    }

    .section .row {
        border: dashed #ccc 1px;
        margin: 10px auto;
        padding: 4px 15px;
        line-height: 34px;
        display: flex;
        width: fit-content;
        margin-left: 0;
    }

    .section .row div {
        margin: auto;
    }

    .section .row .qa_result_id {
        display: none;
    }

    .section .row .score {
        width: 80px;
        margin-right: 30px;
    }

    .section .row .text {
        min-width: 500px;
        margin-right: 30px;
    }

    .section .row .text textarea {
        height: 55px;
    }

    .price_input_div {
        display: flex;
        align-items: center;
    }


    .price_input_div input {
        width: 80px;
        display: block;
    }

    .price_input_div div {
        margin: auto 10px;
        width: fit-content;
    }

    .price_input_div span {
        margin-left: 10px;
        display: block;
    }

    .qa_result {
        display: flex;
        border: 1px solid #cfcfcf;
    }

    #age_score_excel_show #show_excel {
        text-decoration: underline;
        cursor: pointer;
        color: blue;
        flex: 1;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 400px;
    }

    #age_score_excel_show #delete {
        text-decoration: underline;
        cursor: pointer;
        color: red;
        padding-right: 5px;
    }

    #m_sd_excel_show #show_excel {
        text-decoration: underline;
        cursor: pointer;
        color: blue;
        flex: 1;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 400px;
    }

    #m_sd_excel_show #delete {
        text-decoration: underline;
        cursor: pointer;
        color: red;
        padding-right: 5px;
    }


    .tab-content>.tab-pane {
        display: block;
    }
</style>